<template>
  <el-dialog
    title="案件审核"
    :visible.sync="visible"
    :close-on-click-modal="false"
    :modal-append-to-body="false"
    :modal="false"
    width="40%"
  >
    <el-form ref="form" :model="form" label-width="80px">
      <el-form-item label="审核说明">
        <el-input type="textarea" v-model="form.desc"></el-input>
      </el-form-item>

      <el-form-item label="处理人">
        {{ item.deal_admin_id }}
      </el-form-item>

      <el-form-item>
        <el-button size="small" @click="cancel">取消</el-button>
        <el-button type="primary" size="small" @click="submit"
          >发送审核回执</el-button
        >
      </el-form-item>
    </el-form>
  </el-dialog>
</template>
<script>
export default {
  props: [],
  data() {
    return {
      // 要提交的参数
      item: {},
      form: {},

      // 菜单表单
      loading: false,
      visible: false,
      submiting: false
    }
  },
  methods: {
    show(row) {
      this.form = {}
      this.visible = true
      this.item = row
      console.log(row)
    },
    submit() {
      this.form.id = this.item.id
      console.log(this.form)

      this.$api.alarm
        .casesAudit({
          data: this.form
        })
        .then(res => {
          console.log(res)
          if (res.data.code === 0) {
            this.visible = false
            this.$emit('close')
          } else {
            this.$message.error(res.data.message)
          }
        })
        .catch(error => {
          this.$message.error(error)
        })
    },
    cancel() {
      this.visible = false
    }
  }
}
</script>
<style lang="postcss" scoped>
.el-form-item {
  margin-bottom: 5px;
}
</style>
